/**
 * Created by koudaiwang on 2017/7/20.
 */


var Tradingplatform = require('./dao').Tradingplatform;
module.exports = {
    create: function (tradingplatform) {
        return Tradingplatform.create(tradingplatform).exec();
    },

    getAllPlatform: function () {
        return Tradingplatform.find().sort({ _id: -1}).addCreatedAt().exec();
    },

    getplatformID: function(ID) {
        var query = {};
        if (ID) {
            query._id = ID;
        }
        return Tradingplatform.find(query).sort({ _id: -1}).exec();
    },

    getplatformName: function(name) {
        var query = {};
        if (name) {
            query.name = name;
        }
        return Tradingplatform.find(query).sort({ _id: -1}).exec();
    },

    updateNews: function (content) {

    }
};